package problem.year2022.February;

import java.util.Arrays;

/**
 * @author Liu.Liangyuan 15439
 * @version $Id: Day0211.java, v 0.1 2022年02月11日 1:36 下午 Liangmu Exp $$
 */
public class Day0211 {
    public static void main(String[] args) {
        boolean b = true;
        String s = String.valueOf(b);
        System.out.println(s);
//        int[] a = {9,4,1,7};
//        int res = minimumDifference(a, 2);
//        System.out.println(res);
    }

    public static int minimumDifference(int[] nums, int k) {
        Arrays.sort(nums);
        int len = nums.length - k + 1;
        int result = Integer.MAX_VALUE;
        for (int i = 0; i < len; i++) {
            int a = nums[i];
            int b = nums[i + k - 1];
            result = Math.min(b - a, result);
        }
        return result;
    }
}
